﻿@model List<OnlineShop.Models.CartItem>
@{
    ViewBag.Title = "Thanh toán";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="content">
    <div class="section group">
        @if (Model.Count > 0)
        {
            <table class="table">
                <thead>
                    <tr>
                        <td>Mã SP</td>
                        <td>Tên SP</td>
                        <td>Ảnh SP</td>
                        <td>Số lượng</td>
                        <td>Đơn giá</td>
                        <td>Thành tiền</td>
                        <td></td>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>@item.Product.ID</td>
                            <td>@item.Product.Name</td>
                            <td><img src="@item.Product.Image" width="100" /></td>
                            <td><input type="text" class="txtQuantity" data-id="@item.Product.ID" value="@item.Quantity" /></td>
                            <td>@item.Product.Price.GetValueOrDefault(0).ToString("N0")</td>
                            <td>@((item.Product.Price.GetValueOrDefault(0) * item.Quantity).ToString("N0"))</td>
                            <td><a href="#" data-id="@item.Product.ID" class="btn-delete">Xoá</a></td>
                        </tr>
                    }

                </tbody>
            </table>
        }

    </div>
    <div class="section group">
        <div class="col-md-6">
            @using (Html.BeginForm("Payment", "Cart", FormMethod.Post))
            {
                <div class="form-group">
                    <label>Người nhận</label>
                    <input name="shipName" class="form-control" />
                </div>
                <div class="form-group">
                    <label>Điện thoại</label>
                    <input name="mobile" class="form-control" />
                </div>
                <div class="form-group">
                    <label>Địa chỉ</label>
                    <input name="address" class="form-control" />
                </div>
                <div class="form-group">
                    <label>Email</label>
                    <input name="email" class="form-control" />
                </div>
                <button type="submit" class="btn">Gửi đơn hàng</button>
            }
        </div>
       
    </div>
</div>
